********************************************************************************
*	PROJECT: Childhood confidence and long-term outcomes (PSID)
*	PURPOSE: Set up regressions (controls) for all main tables 
*	PUBLISHED: August 2022
*	CONTACT: Hannah Ruebeck, hruebeck@mit.edu	
********************************************************************************


** Paths;
local path "/Users/XXXXX/Downloads/replication materials"


local RAW "`path'/raw"
local CLEAN "`path'/clean"


/*
Description: This code sets up globals that contain the control 
variables used in our regressions, for each of the specifications and
defines a cluster variable. It must be run at the begining of any 
dofile that runs regressions. 
*/
 

********************************************************************************
// Define globals for clustering
global cluster famid1997

********************************************************************************
// Define globals for each set of controls
 
#delimit ;
local demog c_chld_white c_chld_black c_chld_hisp c_female 
	i.c_birthyear i.r_birthquarter i.c_state i.year i.c_fst_age_meas_conf_round;
	
local demog2 c_familytaxableincome2016d c_familytaxableincome2016d_sq  
	r_atleast_grad_hs_ged_dad m_atleast_grad_hs_ged_dad
	r_atleast_grad_hs_ged_mom m_atleast_grad_hs_ged_mom r_atleast_grad_bach_dad 
	m_atleast_grad_bach_dad r_atleast_grad_bach_mom m_atleast_grad_bach_mom;
	
local demog3 c_recgovtransfers r_fatherinhh m_fatherinhh c_twoadulthh; 

foreach wt in "_w0" "_w1" "_w2" "_w3" {;
	local health`wt' r_std_pcgratedchildhlth`wt' m_std_pcgratedchildhlth`wt';
	
	local big5`wt' r_fst_chld_big5_conscientious`wt' r_fst_chld_big5_extroversion`wt' 
		r_fst_chld_big5_neuroticism`wt' r_fst_chld_big5_agreeableness`wt' r_fst_chld_big5_openness`wt'
		m_fst_chld_big5_conscientious`wt' m_fst_chld_big5_extroversion`wt' 
		m_fst_chld_big5_neuroticism`wt' m_fst_chld_big5_agreeableness`wt' m_fst_chld_big5_openness`wt';

	local ability`wt' r_fst_chld_digitspantotal_raw m_fst_chld_digitspantotal_raw
		r_fst_std_gencnf_overall`wt' m_fst_std_gencnf_overall`wt' c_fst_*math_decile* r_fst_*read_decile* m_fst_chld_read_total_pctile_dv;
	
	local parenting`wt' r_mostimp_obey r_mostimp_thinkforself r_mostimp_workhard 
		r_mostimp_helpothers m_mostimp_obey r_std_pcggendernorms`wt' m_std_pcggendernorms`wt'; 
	
	local parent_conf`wt' r_std_pcgselfesteem`wt' m_std_pcgselfesteem`wt'
		r_std_pcgselfeffic`wt' m_std_pcgselfeffic`wt' r_std_pcgparentingagg`wt' m_std_pcgparentingagg`wt';	

	local teacher_beliefs`wt' r_fst_tch_std_acadcomp`wt' m_fst_tch_std_acadcomp`wt' r_fst_tch_std_physcomp`wt' m_fst_tch_std_physcomp`wt' r_fst_tch_std_soccomp`wt' 		m_fst_tch_std_soccomp`wt' r_fst_tch_pred_postbach r_fst_tch_pred_bach r_fst_tch_pred_hsgrad m_fst_tch_pred_final_educ ;
};


local parent_investment r_pp_read m_pp_read r_pp_sports m_pp_sports r_pp_homework m_pp_homework 
	r_pp_games m_pp_games r_pp_physaffect m_pp_physaffect r_pp_saidily m_pp_saidily 
	r_fst_parent_pred_postbach r_fst_parent_pred_bach r_fst_parent_pred_hsgrad m_fst_parent_pred_final_educ;
	
local parent_occ r_occ_stem_mom m_occ_stem_mom r_occ_stem_dad m_occ_stem_dad
	  r_occ_othhiskll_mom m_occ_othhiskll_mom r_occ_othhiskll_dad m_occ_othhiskll_dad ;

	

foreach wt in "_w0" "_w1" "_w2" "_w3" {;
	
	global spec1`wt' `demog' `demog2' `ability`wt'';
	global spec2`wt' `demog' `demog2' `demog3' `ability`wt'' `health`wt'' `parenting`wt'' `parent_conf`wt'' `parent_occ';
	global spec3`wt' `demog' `demog2' `demog3' `ability`wt'' `health`wt'' `parenting`wt'' `parent_conf`wt'' `parent_occ' `big5`wt'';	 	  
	global spec4`wt' `demog' `demog2' `demog3' `ability`wt'' `health`wt'' `parenting`wt'' `parent_conf`wt'' `parent_occ' `teacher_beliefs`wt'' `parent_investment';	 
};


foreach wt in "" "_w1" "_w2" "_w3" {;

global extracontrols_adultconf`wt' " r_sec_*decile* m_sec_chld_math_ap_pctile_dv  m_sec_chld_read_total_pctile_dv r_sec_std_gencnf_overall`wt' m_sec_std_gencnf_overall`wt' m_sec_chld_digitspantotal_raw r_sec_chld_digitspantotal_raw";

};

global extra_testscores "r_sec_*decile* m_sec_chld_math_ap_pctile_dv  m_sec_chld_read_total_pctile_dv"; 


#delimit cr


